﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;

namespace VmcRemote.Common.Power
{
    internal class PowerBroadcast
    {
        public PowerBroadcast(int size)
        {
            m_data = new byte[size];
        }
        byte[] m_data;
        public byte[] Data { get { return m_data; } }
        public PowerEventType Message { get { return (PowerEventType)BitConverter.ToInt32(m_data, 0); } }
        public PowerState Flags { get { return (PowerState)BitConverter.ToInt32(m_data, 4); } }
        public int Length { get { return BitConverter.ToInt32(m_data, 8); } }
        public byte[] SystemPowerState { get { byte[] data = new byte[Length]; Buffer.BlockCopy(m_data, 12, data, 0, Length); return data; } }
    }
}
